package com.example.thread;


import java.io.IOException;

public class TestThread2 extends Thread{

   /* private String url;
    private String name;

    public TestThread2(String url,String name)
    {
        this.url = url;
        this.name = name;
    }

    @Override
    public void run() {
       WebDownLoder webDownLoder = new WebDownLoder();
       webDownLoder.downloder(url,name);
        System.out.println("下载了文件名为"+name);
    }

    public static void main(String[] args) {
        TestThread2 testThread2_1 = new TestThread2("....","1");
        TestThread2 testThread2_2 = new TestThread2("....","2");
        TestThread2 testThread2_3 = new TestThread2("....","3");

        testThread2_1.start();
        testThread2_2.start();
        testThread2_3.start();
    }


}

//下载器  下载网上的图片
class WebDownLoder{
    //下载方法
    public void downloder(String url,String name)
    {
        try {
            //要下载包
             FileUtils.copyURLTOFile(new URL(url),new File(name));
        }catch (IOException e){
            e.printStackTrace();
            System.out.println("出问题");
        }
    }*/
}
